import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
import * as dotenv from 'dotenv';
import { json } from 'express';

dotenv.config();

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.enableCors();
  app.use(json({ limit: '10mb' }));

  app.useGlobalPipes(new ValidationPipe());
  console.log('process.env.PORT', 'localhost:2000');
  await app.listen(process.env.PORT || 2000);
}
bootstrap().catch(console.error);
